import request from '@/utils/request.js';

export default {
  // 获取记账记录列表
  getRecords(params = {}) {
    return request.get('/records/list', params);
  },

  // 添加记账记录
  addRecord(data) {
    return request.post('/records/add', data);
  },

  // 更新记账记录
  updateRecord(id, data) {
    return request.put(`/records/${id}`, data);
  },

  // 删除记账记录
  deleteRecord(id) {
    return request.delete(`/records/${id}`);
  },

  // 获取统计信息
  getStatistics(params) {
    return request.get('/records/statistics', params);
  },

  // 获取月度统计
  getMonthlyStats(year, month) {
    return request.get('/records/statistics/monthly', { year, month });
  }
};